package tjs.study.notes.dotest.jdk.thread;

import java.util.concurrent.Callable;
import java.util.concurrent.FutureTask;

/**
 * Created by Nicky.Tang on 2021/11/19 6:58 上午
 *
 * @since 02.12.10
 */
public class DoTestOfThreeImpl {
    public static void main(String[] args) {
        new ExtendThred().start();
        new Thread(new RunnableImpl()).start();
        //FutureTask implements Runnable
        new Thread(new FutureTask(new CallaleImpl())).start();
    }
    public static class ExtendThred extends Thread{
        @Override//重写
        public void run(){
            System.out.println("running...");
        }
    }
    public static class RunnableImpl implements Runnable{
        @Override
        public void run() {
            System.out.println("running...");
        }
    }
    public static class CallaleImpl implements Callable<String> {
        @Override
        public String call() throws Exception {
            System.out.println("running...");
            return "run finshed";
        }
    }
}
